package com.dhl.substitution;

/**
 * @title: Substitution
 * @Author danghailiang
 * @Date: 2022/7/25 11:17
 * @Version 1.0
 */
public class Substitution {
    public static void main(String[] args) {
        B b = new B();
        // 要的实际效果是 a+b，但是实际效果是a*b
        System.out.println(b.fun1(10, 5));
        System.out.println(b.fun2(10,5));
    }
}

class A{
    public int fun1(int a, int b){
        return a+b;
    }
}

class B extends A{
    @Override
    public int fun1(int a, int b){
        return a*b;
    }
    public int fun2(int a, int b){
        return a-b;
    }
}
